package cn.tedu.shoot;

import java.awt.image.BufferedImage;
import java.util.Random;

//小蜜蜂
public class Bee extends FlyingObject implements EnemyAward {
	private int xSpeed; //x坐标移动速度
	private int ySpeed; //y坐标移动速度
	private int awardType;//奖励类型
	public Bee(){
		super(256,128);
		Random rand=new Random();		
		xSpeed=1;
		ySpeed=2;
		awardType=rand.nextInt(2);		
	}
	public void step() {
		x+=xSpeed;
		y+=ySpeed;
		if(x<=0||x>=World.WIDTH-this.width) {
			xSpeed*=-1;
		}
	}
	int index=1;
	public BufferedImage getImage() {
		if(isLive()) {
			return Images.bees[0];
		}else if(isDead()) {
			BufferedImage img=Images.bees[index++];
			if(index==Images.bees.length) {
				state=REMOVE;
				}
			return img;
		}
		return null;			
		}
	public int getAwardType() {
		return awardType;
	}


	
}
